﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            lblError.Text = "";
            return;
        }


        //txtFltDate1.Attributes.Add("onclick", "new Calendar().show(this);");
        //txtFltDate2.Attributes.Add("onclick", "new Calendar().show(this);");
        //txtFltDate3.Attributes.Add("onclick", "new Calendar().show(this);");

        //注册用户也可能使用机器人！
        //if (Session["UID"] != null)
        //{
        //    Image1.Visible = true;
        //    txtChkCode.Visible = true;
        //}
        //else
        //{
        //    Image1.Visible = false;
        //    txtChkCode.Visible = false;
        //}
            
    }
    protected void lstTipsCount_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (lstTripCount.Text == "1")
        {
            lstOriCity1.Visible = true;
            lstDesCity1.Visible = true;
            lstDesCity2.Visible = false;
            lstDesCity3.Visible = false;
            txtFltDate1.Visible = true;
            lstOriCity2.Visible = false;
            txtFltDate2.Visible = false;
            lstOriCity3.Visible = false;
            txtFltDate3.Visible = false;
            lblSn1.Visible = true;
            lblSn2.Visible = false;
            lblSn3.Visible = false;
        }
        else if (lstTripCount.Text == "2")
        {
            lstOriCity1.Visible = true;
            txtFltDate1.Visible = true;
            lstOriCity2.Visible = true;
            txtFltDate2.Visible = true;
            lstOriCity3.Visible = false;
            txtFltDate3.Visible = false;
            lstDesCity1.Visible = true;
            lstDesCity2.Visible = true;
            lstDesCity3.Visible = false;
            lblSn1.Visible = true;
            lblSn2.Visible = true;
            lblSn3.Visible = false;
        }
        else if (lstTripCount.Text == "3")
        {
            lstOriCity1.Visible = true;
            lstDesCity1.Visible = true;
            lstDesCity2.Visible = true;
            lstDesCity3.Visible = true;
            txtFltDate1.Visible = true;
            lstOriCity2.Visible = true;
            txtFltDate2.Visible = true;
            lstOriCity3.Visible = true;
            txtFltDate3.Visible = true;
            lblSn1.Visible = true;
            lblSn2.Visible = true;
            lblSn3.Visible = true;
        }
        
    }
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        Session["TRIP_COUNT"] = lstTripCount.SelectedValue;
        Session["ADT_COUNT"] = lstAdtCount.SelectedValue;
        Session["CHD_COUNT"] = lstChdCount.SelectedValue;
        Session["INF_COUNT"] = lstInfCount.SelectedValue;
        Session["lstOriCity1"] = lstOriCity1.SelectedValue;
        Session["lstOriCity2"] = lstOriCity2.SelectedValue;
        Session["lstOriCity3"] = lstOriCity3.SelectedValue;
        Session["lstDesCity1"] = lstDesCity1.SelectedValue;
        Session["lstDesCity2"] = lstDesCity2.SelectedValue;
        Session["lstDesCity3"] = lstDesCity3.SelectedValue;
        Session["txtFltDate1"] = txtFltDate1.Text;
        Session["txtFltDate2"] = txtFltDate2.Text;
        Session["txtFltDate3"] = txtFltDate3.Text;

        Response.Redirect("flt_avail_ajax.aspx");
    }
    protected void btnQueryOld_Click(object sender, EventArgs e)
    {
        Session["TRIP_COUNT"] = lstTripCount.SelectedValue;
        Session["ADT_COUNT"] = lstAdtCount.SelectedValue;
        Session["CHD_COUNT"] = lstChdCount.SelectedValue;
        Session["INF_COUNT"] = lstInfCount.SelectedValue;
        Session["lstOriCity1"] = lstOriCity1.SelectedValue;
        Session["lstOriCity2"] = lstOriCity2.SelectedValue;
        Session["lstOriCity3"] = lstOriCity3.SelectedValue;
        Session["lstDesCity1"] = lstDesCity1.SelectedValue;
        Session["lstDesCity2"] = lstDesCity2.SelectedValue;
        Session["lstDesCity3"] = lstDesCity3.SelectedValue;
        Session["txtFltDate1"] = txtFltDate1.Text;
        Session["txtFltDate2"] = txtFltDate2.Text;
        Session["txtFltDate3"] = txtFltDate3.Text;

        Response.Redirect("flt_avail.aspx");
    }
    
}
